package com.numbfish.ch01_ex06_event.config;

import com.numbfish.ch01_ex06_event.event.MethodExecutionEventListener;
import com.numbfish.ch01_ex06_event.event.MethodExecutionEventPublisher;
import com.numbfish.ch01_ex06_event.pojo.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CustomConfig {
    @Bean
    public Person person(){
        return new Person(1,"曹操",44);
    }
    @Bean
    public MethodExecutionEventPublisher eventPublisher() {
        return new MethodExecutionEventPublisher();
    }
    @Bean
    public MethodExecutionEventListener methodToMonitor() {
        return new MethodExecutionEventListener();
    }
}
